package com.micro.ai.files.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 文件附件响应DTO
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@Schema(description = "文件附件信息")
public class FileAttachmentDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "文件ID", example = "file_123456789")
    private String id;

    @Schema(description = "租户ID", example = "tenant_001")
    private String tenantId;

    @Schema(description = "存储文件名", example = "uploads/2025/01/abc123.jpg")
    private String filename;

    @Schema(description = "原始文件名", example = "我的文档.jpg")
    private String originalName;

    @Schema(description = "文件路径", example = "/data/files/uploads/2025/01/abc123.jpg")
    private String filePath;

    @Schema(description = "文件大小（字节）", example = "1048576")
    private Long fileSize;

    @Schema(description = "MIME类型", example = "image/jpeg")
    private String mimeType;

    @Schema(description = "文件类型", example = "image")
    private String fileType;

    @Schema(description = "存储提供商", example = "local")
    private String storageProvider;

    @Schema(description = "关联类型", example = "model_dataset")
    private String associatedType;

    @Schema(description = "关联ID", example = "dataset_123")
    private String associatedId;

    @Schema(description = "上传者ID", example = "user_001")
    private String uploaderId;

    @Schema(description = "是否公开", example = "false")
    private Boolean isPublic;

    @Schema(description = "创建时间", example = "2025-01-01 00:00:00")
    private LocalDateTime createdAt;

    /**
     * 文件大小格式化（如：1.5 MB）
     */
    @Schema(description = "文件大小格式化", example = "1.5 MB")
    private String fileSizeFormatted;

    /**
     * 下载URL
     */
    @Schema(description = "下载URL", example = "/api/files/download/file_123456789")
    private String downloadUrl;
}

